<?php


namespace app\api\controller\dashboard;


use app\api\controller\Api;
use app\common\customer\model\CustomerAllocate;

class Task extends Api
{
    public function index()
    {
        $user = $this->request->user;
        $result = [];

        $today = strtotime('today');
        $where = [];
        $where[] = ['user_id', '=', $user['id']];
        $where[] = ['next_visit_time', ">", $today];
        $allocateModel = new CustomerAllocate();
        $result['nextVisit'] = $allocateModel->where($where)->count();

        $result['additional'] = 0;
        $result['income'] = 0;
        $result['payment'] = 0;
        return success($result);
    }
}